Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallback layout styles for Post Template #4639

Conversation

tellthemachines
Copy link
Contributor

Trac ticket: https://core.trac.wordpress.org/ticket/58570

Adds the Post Template fallback styles for classic themes from WordPress/gutenberg#49050, following the same logic already used for the Columns block.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure how to test this individual patch, but I've applied the patch locally and can't see any regressions with new and existing post template blocks for block and classic themes (I used grid view in query blocks).

The changes match those in the Gutenberg PR.

Do these unit tests need to be ported over? Or will they be taken care of in #4625?

@@ -1053,11 +1053,13 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets'
}
$stylesheet .= $this->get_block_classes( $style_nodes );
} elseif ( in_array( 'base-layout-styles', $types, true ) ) {
$root_selector = static::ROOT_BLOCK_SELECTOR;
$columns_selector = '.wp-block-columns';
$root_selector = static::ROOT_BLOCK_SELECTOR;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we need a @since annotation in the function PHPDoc block? E.g.,

* @since 6.3.0 Add fallback layout styles for Post Template when block gap support isn't available. ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point, yes, I'll add that in!

@tellthemachines
Copy link
Contributor Author

Do these unit tests need to be ported over? Or will they be taken care of in #4625?

I think I need to commit #4625 first and then rebase this one, because the tests are still passing without updating the string.

@tellthemachines tellthemachines force-pushed the backport/post-template-fallback-styles branch from b18e747 to 7d51eaa Compare June 22, 2023 04:08
@tellthemachines
Copy link
Contributor Author

Hmmm, looks like the fallback styles are not being output yet, because the packages haven't been updated, so Post Template block still doesn't have spacing support, so this check fails 😞

This is a small PR so I guess it can wait until the packages are updated, and once they are I can update the unit test string.

@getsource
Copy link
Member

That approach makes sense to me as well!

@tellthemachines tellthemachines force-pushed the backport/post-template-fallback-styles branch from 7d51eaa to e6c4810 Compare June 28, 2023 01:29
@tellthemachines
Copy link
Contributor Author

committed in r56083 / 518a4fc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants